System.register(["@angular/http", "ng2-layer", "@angular/core"], function (exports_1, context_1) {
    "use strict";
    var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
        var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
        if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
        else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
        return c > 3 && r && Object.defineProperty(target, key, r), r;
    };
    var __metadata = (this && this.__metadata) || function (k, v) {
        if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
    };
    var __moduleName = context_1 && context_1.id;
    var http_1, ng2_layer_1, core_1, SettingComp, _a;
    return {
        setters: [
            function (http_1_1) {
                http_1 = http_1_1;
            },
            function (ng2_layer_1_1) {
                ng2_layer_1 = ng2_layer_1_1;
            },
            function (core_1_1) {
                core_1 = core_1_1;
            }
        ],
        execute: function () {
            SettingComp = (function () {
                function SettingComp(http, layer) {
                    var _this = this;
                    this.http = http;
                    this.layer = layer;
                    this.tab = "base";
                    this.http.get({
                        search: {
                            m: "Admin",
                            c: "ApiWallet",
                            a: "get_user_wallet"
                        }
                    }).then(function (data) {
                        _this.isbind = data.data.is;
                        if (_this.isbind == 0) {
                            _this.router.navigateByUrl('/bind_wx');
                        }
                    });
                }
                SettingComp.prototype.swichTab = function (tab) {
                    this.tab = tab;
                };
                SettingComp.prototype.savePwd = function () {
                    this.http.post({
                        search: {
                            m: "Admin",
                            c: "ApiAdmin",
                            a: "updateAdminPassword"
                        },
                        body: {
                            oldPassword: this.oldPassword,
                            newPassword: this.newPassword
                        }
                    }).then(function (data) {
                        layer.tip({
                            message: "密码修改成功",
                            align: "top"
                        });
                    });
                };
                return SettingComp;
            }());
            SettingComp = __decorate([
                core_1.Component({
                    selector: '.category',
                    templateUrl: 'template/router/setting.html'
                }),
                __metadata("design:paramtypes", [http_1.Http, typeof (_a = typeof ng2_layer_1.NgLayer !== "undefined" && ng2_layer_1.NgLayer) === "function" && _a || Object])
            ], SettingComp);
            exports_1("SettingComp", SettingComp);
        }
    };
});
